package com.uplift.mobile.rate.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

@Service
public class UpdateRateJob  {
    public UpdateRateJob() {
        System.out.println("初始化成功");
    }

    @Autowired
    private IRateService rateService;

    @Scheduled(cron="0 0 */2 * * ? ")   //每两个小时执行一次
    public void updateRate(){
        rateService.updateRate();
    }

}
